#if(CMAKE_Fortran_COMPILER)
#  set(F77SRCS addmult.f transpose.f)
#  ADD_LIBRARY(flibs ${F77SRCS})
#endif()
#
ADD_EXECUTABLE(fft_alloc_bench fft_alloc_bench.cpp)
TARGET_LINK_LIBRARIES(fft_alloc_bench ohmmsbase ${BLAS_LIBRARY})

ADD_EXECUTABLE(rk4 rk4.cpp) 
TARGET_LINK_LIBRARIES(rk4 ohmmsbase flibs)

ADD_EXECUTABLE(vorticity vorticity.cpp)
TARGET_LINK_LIBRARIES(vorticity ohmmsbase flibs)

ADD_EXECUTABLE(fft2d_smp fft2d_smp.cpp)
TARGET_LINK_LIBRARIES(fft2d_smp ohmmsbase flibs)

ADD_EXECUTABLE(fft2d_mix fft2d.cpp)
TARGET_LINK_LIBRARIES(fft2d_mix ohmmsbase flibs)

IF(HAVE_ESSL)
ADD_EXECUTABLE(fft2d_essl fft2d_essl.cpp)
TARGET_LINK_LIBRARIES(fft2d_essl ohmmsbase)
ENDIF(HAVE_ESSL)

#ADD_EXECUTABLE(fft_bench fft_bench.cpp)
#TARGET_LINK_LIBRARIES(fft_bench ohmmsbase ${BLAS_LIBRARY})

#ADD_EXECUTABLE(trans_bench trans_bench.cpp)
#TARGET_LINK_LIBRARIES(trans_bench ohmmsbase ${BLAS_LIBRARY})

#ADD_EXECUTABLE(fft_stride fft_stride.cpp)
#TARGET_LINK_LIBRARIES(fft_stride ohmmsbase ${BLAS_LIBRARY})
#
#ADD_EXECUTABLE(fft_omp fft_omp.cpp)
#TARGET_LINK_LIBRARIES(fft_omp ohmmsbase ${BLAS_LIBRARY})

#ADD_EXECUTABLE(dummy_dns dns.cpp)
#TARGET_LINK_LIBRARIES(dummy_dns ohmmsbase)

if(HAVE_MPI)
  #ADD_EXECUTABLE(alltoall alltoall.cpp)
  #TARGET_LINK_LIBRARIES(alltoall ohmmsbase ${BLAS_LIBRARY})
  if(P3DFFT_FOUND)
    #ADD_EXECUTABLE(dummy_dns dns.cpp)
    #TARGET_LINK_LIBRARIES(dummy_dns ohmmsbase ${BLAS_LIBRARY})
    add_executable(p3dfft_bench p3dfft_bench.cpp)
    target_link_libraries(p3dfft_bench ohmmsbase ${BLAS_LIBRARY} ${FORTRAN_LIBS} ${P3DFFT_LIBRARY})
    #add_executable(p3dfft_mem p3dfft_mem.cpp)
    #target_link_libraries(p3dfft_mem ohmmsbase ${BLAS_LIBRARY} ${FORTRAN_LIBS} ${P3DFFT_LIBRARY})
  endif(P3DFFT_FOUND)
endif(HAVE_MPI)

#ADD_EXECUTABLE(vector vector.cpp print_timing.cpp)
#TARGET_LINK_LIBRARIES(vector ohmmsf77 ohmmsbase)

#ADD_EXECUTABLE(ohmms ohmms.cpp print_timing.cpp ${F77SRCS})
#TARGET_LINK_LIBRARIES(ohmms ohmmsbase)

#IF(FOUND_BOOST)
#ADD_EXECUTABLE(ublasvector ublasvector.cpp  print_timing.cpp)
#TARGET_LINK_LIBRARIES(ublasvector ohmmsbase)
#ENDIF(FOUND_BOOST)

#IF(FOUND_BLITZ)
#ADD_EXECUTABLE(blitz blitz.cpp  print_timing.cpp)
#TARGET_LINK_LIBRARIES(blitz ohmmsbase)
#ENDIF(FOUND_BLITZ)

#mtl does not seem to have a simple vector
#ADD_EXECUTABLE(mtlvector mtlvector.cpp  print_timing.cpp)
#TARGET_LINK_LIBRARIES(mtlvector ohmmsf77 ohmmsbase)
